package com.xt.purchasingsystem.mapper;

import com.xt.purchasingsystem.model.MProcedure;
import com.xt.purchasingsystem.vo.MProcedureVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MProcedureMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MProcedure record);

    int insertSelective(MProcedure record);

    MProcedure selectByPrimaryKey(Integer id);
    MProcedure selectByParentIdAndProcedureId(@Param("parentId") Integer parentId, @Param("procedureId") Integer procedureId);

    int updateByPrimaryKeySelective(MProcedure record);

    int updateByPrimaryKey(MProcedure record);

    /**
     * 根据生产编号查询此生产的所有生产工序
     * @param parentId
     * @return
     */
    List<MProcedure> getAllByParentId(Integer parentId);

    List<MProcedureVo> getAllVoByParentId(Integer parentId);

    /**
     * 根据编号修改工序交接标志和工序合格数量的接口
     * @param id
     * @param realAmount
     * @return
     */
    int updateRealAmountAndTransferTag(@Param("id") Integer id, @Param("transFerTag") String transFerTag, @Param("realAmount") Double realAmount);
    /**
     * 根据编号修改工序完成标志
     * @param id
     * @param procedureFinishTag
     * @return
     */
    int updateProcedureFinishTagById(@Param("id") Integer id, @Param("procedureFinishTag") String procedureFinishTag);
}